<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Object.keys/values/entries</title>
</head>
<body>
    <h1>Object.keys()，Object.values()，Object.entries()</h1>

    <script>
        const obj = {
            name: '张三',
            age: 18,
            city: '北京'
        };

        // Object.keys()
        console.log(Object.keys(obj));
        // ['name', 'age', 'city']

        // Object.values()
        console.log(Object.values(obj));
        // ['张三', 18, '北京']

        // Object.entries()
        console.log(Object.entries(obj));
        // [['name', '张三'], ['age', 18], ['city', '北京']]
    </script>
</body>
</html> 